﻿/*
 * Created by SharpDevelop.
 * User: xieen
 * Date: 2013-08-23
 * Time: 15:21
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace GoF23Learning._16.Oberver_Pattern.Refactor
{
	/// <summary>
	/// Description of Event.
	/// </summary>
	public class BankAccountEvent
	{
		public event AccountChangedHandler AccountChanged;
		public void Withdraw(int data)
		{
			AccountArgs Account =new AccountArgs();
			Account.Address = "CQ";
			Account.MobileNo = "139";
			Account.Overage = data;
			OnAccountChanged(Account);
		}
		
		protected  virtual void OnAccountChanged(AccountArgs args)
		{
			if(AccountChanged!=null){			 
				AccountChanged(this,args);			
			}
		}
	}
}
